package com.sztx.pay.center.core.service.util;

import java.io.IOException;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class BanksManage {
	private static Properties props = null;
	private static Logger logger = LoggerFactory.getLogger(BanksManage.class);
	static{
		props = new Properties();
		try {
			props.load(BanksManage.class.getResourceAsStream("/banks.properties"));
		} catch (IOException e) {
			logger.error("文件不存在！"+e);
		}
	}
	public static String getbankidBySwiftCode(String swiftcode){
		if(props.get(swiftcode) == null){
			return null;
		}
		return props.get(swiftcode).toString();
	}
	/**
	 * 查询对公银行还是对私银行
	 * @param swiftcode
	 * @return
	 */
	public static int getcardActType(String swiftcode,String bankType){
		if(props.get(swiftcode+"_"+bankType) != null)
			return Integer.parseInt(props.get(swiftcode+"_"+bankType).toString());
		else
			return 1;
	}
}
